package com.link.service;

import com.link.dao.AccountDAO;
import com.link.entity.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by wangyg 
 * on 2017/2/21 10:46
 */
@Service
public class AccountServiceImpl implements AccountService {
	@Autowired
	AccountDAO accountDAO;

	@Transactional
	public void transfer(String in, String out, Double value) throws Exception {
		accountDAO.outMoney(out, value);
		int a=1/0;
		accountDAO.inMoney(in, value);
	}

	@Override
	public Account select(String s) {
		return accountDAO.select(s);
	}
}
